package cn.chongqing.han.hellotoolkit;

import android.app.Activity;
import android.os.Bundle;

import java.io.IOException;

import cn.chongqing.han.toolkit.LogUtil;
import cn.chongqing.han.toolkit.net.NetConnUtil;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        NetConnUtil.get("http://172.16.1.90:8080/app/rank/getRankingInfo", new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {

                LogUtil.out("网络工具结果：onFailure(%s)", e.toString());
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
                LogUtil.out("网络工具结果：%s", response.body().string());
            }
        });
    }
}
